<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<div class="table-responsive">
    <table class="table table-bordered">
        <thead>
        <tr>
            <th class="text-center"><div class="table-first-id">ID</div></th>
            <th class="text-center" width="20%">创建人</th>
            <th class="text-center" width="20%">跳转类型</th>
            <th class="text-center" width="25%">描述</th>
            <th class="text-center" width="10%">状态</th>
            <th class="text-center" width="20%">操作</th>
        </tr>
        </thead>
    </table>
    <div class="J_V_tabContent table-xScrollWrap">
        <table class="table table-bordered table-hover table-xs-content">
            <tbody>
            <tr class="jqgfirstrow" role="row">
                <th class="text-center"><div class="table-first-id">&nbsp;</div></th>
                <th class="text-center" width="20%">&nbsp;</th>
                <th class="text-center" width="20%">&nbsp;</th>
                <th class="text-center" width="25%">&nbsp;</th>
                <th class="text-center" width="10%">&nbsp;</th>
                <th class="text-center" width="20%">&nbsp;</th>
            </tr>
            <tr th:if="${#lists.isEmpty(dataMap['list'])}">
                <td colspan="6" class="text-center">
                    <div class="noDataTipsBox">
                        <p><span class="c-4e fs16">亲，还没有数据~~~</span></p>
                    </div>
                </td>
            </tr>
            <tr th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="advert:${dataMap['list']}" th:attr="data-id=${advert['id']},id='advert-tr-'+${advert['id']}">
                    <td class="text-center">
                        <input type="checkbox" class="i-checks" name="advertId" th:value="${advert['id']}" th:text="${advert['id']}"/>
                    </td>
                    <td class="text-center">
                        <span th:if="${advert['createUser']}!=null" th:text="${advert['createUser']['username']}"></span>
                        <span th:if="${advert['createUser']}==null">—</span>
                    </td>
                    <td class="text-center">
                        <span th:if="${advert['redirectType']}==0">未指定</span>
                        <span th:if="${advert['redirectType']}==1">专题页面</span>
                        <span th:if="${advert['redirectType']}!=1 and ${advert['redirectType']}!=3 and ${advert['redirectType']}!=0">课程详情</span>
                        <span th:if="${advert['redirectType']}==3">外链地址</span>
                    </td>
                    <td class="text-center" th:text="${advert['depict']}"></td>
                    <td class="text-center" th:attr="id='advert-status-'+${advert['id']}">
                        <span th:if="${advert['status']}==1" class="label label-info">正常</span>
                        <span th:if="${advert['status']}==2" class="label label-danger">禁用</span>
                    </td>
                    <td class="text-center">
                        <a href="javascript:void(0);" class="c-master fs14 look-view-advert" th:attr="data-id=${advert['id']}" data-toggle="tooltip" data-placement="bottom" data-original-title="查看">
                            <i class="fa fa-eye"></i>
                        </a>
                        <a th:href="@{/admin/op/advert/toSaveUpdateOpAdvert?id={advertId}(advertId=${advert['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="修改">
                            <i class="fa fa-edit"></i>
                        </a>
                        <a th:if="${advert['status']}==1" href="javascript:void(0);" class="c-master fs14 ml5 update-advert-status" th:attr="id='simple-status-'+${advert['id']},data-id=${advert['id']}"  data-status="2" data-toggle="tooltip" data-placement="bottom" data-original-title="禁用">
                            <i class="fa fa-unlock-alt"></i>
                        </a>
                        <a th:if="${advert['status']}==2" href="javascript:void(0);" class="c-master fs14 ml5 update-advert-status" th:attr="id='simple-status-'+${advert['id']},data-id=${advert['id']}"  data-status="1" data-toggle="tooltip" data-placement="bottom" data-original-title="恢复">
                            <i class="fa fa-history"></i>
                        </a>

                        <a href="javascript:void(0);" class="c-master fs14 ml5 remove-advert" th:attr="data-id=${advert['id']}"  data-toggle="tooltip" data-placement="bottom" data-original-title="删除">
                            <i class="fa fa-trash-o"></i>
                        </a>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <!-- 分页，开始 -->
    <div data-th-replace="layout/adminPage"></div>
    <!-- 分页，结束 -->
</div>

